#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "UMLDiagramElement.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Bounds;
class UMLLabel;

/// <summary>
/// UMLDiagram
/// The most general class for UML diagrams.
/// </summary>
class UMLMODEL_EXPORT UMLDiagram : public UMLDiagramElement {

public: // Constructors and destructors
    explicit UMLDiagram(const QString& umlType="uml::UMLDiagram");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// isFrame getter
    /// Indicates when diagram frames shall be shown.
    /// </summary>
    bool isFrame() const;

    /// <summary>
    /// isFrame setter
    /// Indicates when diagram frames shall be shown.
    /// </summary>
    void setIsFrame(bool value);

    /// <summary>
    /// isIso getter
    /// Indicate when ISO notation rules shall be followed.
    /// </summary>
    bool isIso() const;

    /// <summary>
    /// isIso setter
    /// Indicate when ISO notation rules shall be followed.
    /// </summary>
    void setIsIso(bool value);

    /// <summary>
    /// heading getter
    /// </summary>
    shared_ptr<UMLLabel> heading() const;

    /// <summary>
    /// heading setter
    /// </summary>
    void setHeading(shared_ptr<UMLLabel> value);

    /// <summary>
    /// isInheritedLighter getter
    /// </summary>
    bool isInheritedLighter() const;

    /// <summary>
    /// isInheritedLighter setter
    /// </summary>
    void setIsInheritedLighter(bool value);

    /// <summary>
    /// name getter
    /// the name of the diagram.
    /// </summary>
    QString name() const;

    /// <summary>
    /// name setter
    /// the name of the diagram.
    /// </summary>
    void setName(const QString& value);

    /// <summary>
    /// documentation getter
    /// the documentation of the diagram.
    /// </summary>
    QString documentation() const;

    /// <summary>
    /// documentation setter
    /// the documentation of the diagram.
    /// </summary>
    void setDocumentation(const QString& value);

    /// <summary>
    /// resolution getter
    /// the resolution of the diagram expressed in user units per inch.
    /// </summary>
    double resolution() const;

    /// <summary>
    /// resolution setter
    /// the resolution of the diagram expressed in user units per inch.
    /// </summary>
    void setResolution(double value);

    /// <summary>
    /// bounds getter
    /// the optional bounds of the shape relative to the origin of its nesting plane.
    /// </summary>
    shared_ptr<Bounds> bounds() const;

    /// <summary>
    /// bounds setter
    /// the optional bounds of the shape relative to the origin of its nesting plane.
    /// </summary>
    void setBounds(shared_ptr<Bounds> value);

private: // Fields
    /// <summary>
    /// isFrame
    /// Indicates when diagram frames shall be shown.
    /// </summary>
    const static bool isFrame_default_;
    bool isFrame_= isFrame_default_;

    /// <summary>
    /// isIso
    /// Indicate when ISO notation rules shall be followed.
    /// </summary>
    const static bool isIso_default_;
    bool isIso_= isIso_default_;

    /// <summary>
    /// heading
    /// </summary>
    shared_ptr<UMLLabel> heading_;

    /// <summary>
    /// isInheritedLighter
    /// </summary>
    const static bool isInheritedLighter_default_;
    bool isInheritedLighter_= isInheritedLighter_default_;

    /// <summary>
    /// name
    /// the name of the diagram.
    /// </summary>
    const static QString name_default_;
    QString name_= name_default_;

    /// <summary>
    /// documentation
    /// the documentation of the diagram.
    /// </summary>
    const static QString documentation_default_;
    QString documentation_= documentation_default_;

    /// <summary>
    /// resolution
    /// the resolution of the diagram expressed in user units per inch.
    /// </summary>
    const static double resolution_default_;
    double resolution_= resolution_default_;

    /// <summary>
    /// bounds
    /// the optional bounds of the shape relative to the origin of its nesting plane.
    /// </summary>
    shared_ptr<Bounds> bounds_;

};

} // namespace uml
